package insight.google.game.era.bo.policy.character;

import insight.google.game.era.bo.GameUser;
import insight.google.game.era.client.proxy.PlayerClientProxy;
import insight.google.game.era.client.proxy.PlayerClientProxyImpl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ZhaoYunPolicy extends CharacterPolicy {
	
    /**
	 * 
	 */
	private PlayerClientProxy playerClientProxy;

	public ZhaoYunPolicy(String id, String name){
		super(id, name);
	}

	@Override
	public boolean onDiscardExec(GameUser original, GameUser[] targets,
			Map params) {
		// TODO Auto-generated method stub
		//enable attack card.
        playerClientProxy = PlayerClientProxyImpl.getInstance();

		String jsComponentId = (String)params.get("jsComponenetId");

		//set target user active card
        List<String> activeCards = new ArrayList<String>();
        activeCards.add("attack");
        activeCards.add("defend");
        activeCards.add("arm");
//        original.setActiveCards(activeCards);
//        playerClientProxy.setActiveCard(original.getScriptProxy(), jsComponenetId, original.getActiveCards());
//
//        playerClientProxy.setActive(original.getScriptProxy(), jsComponenetId, true);
        original.setActiveCards(activeCards,jsComponentId);
        original.setClientActive(true, jsComponentId);
		return false;
	}

}
